package net.onecloud.onecloud.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zaizai on 16/7/28.
 */
public class ResultPost implements Parcelable {


    private int code;
    private int more;
    private int success;
    private String message;
    private List<DataEntity> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getMore() {
        return more;
    }

    public void setMore(int more) {
        this.more = more;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<DataEntity> getData() {
        return data;
    }

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    public static class DataEntity implements Parcelable {

        private String id;
        private String pname;
        private String quantity;
        private String demand;
        private String pay;
        private String welfare;
        private String employ_id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getPname() {
            return pname;
        }

        public void setPname(String pname) {
            this.pname = pname;
        }

        public String getQuantity() {
            return quantity;
        }

        public void setQuantity(String quantity) {
            this.quantity = quantity;
        }

        public String getDemand() {
            return demand;
        }

        public void setDemand(String demand) {
            this.demand = demand;
        }

        public String getPay() {
            return pay;
        }

        public void setPay(String pay) {
            this.pay = pay;
        }

        public String getWelfare() {
            return welfare;
        }

        public void setWelfare(String welfare) {
            this.welfare = welfare;
        }

        public String getEmploy_id() {
            return employ_id;
        }

        public void setEmploy_id(String employ_id) {
            this.employ_id = employ_id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.pname);
            dest.writeString(this.quantity);
            dest.writeString(this.demand);
            dest.writeString(this.pay);
            dest.writeString(this.welfare);
            dest.writeString(this.employ_id);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.pname = in.readString();
            this.quantity = in.readString();
            this.demand = in.readString();
            this.pay = in.readString();
            this.welfare = in.readString();
            this.employ_id = in.readString();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeInt(this.more);
        dest.writeInt(this.success);
        dest.writeString(this.message);
        dest.writeList(this.data);
    }

    public ResultPost() {
    }

    protected ResultPost(Parcel in) {
        this.code = in.readInt();
        this.more = in.readInt();
        this.success = in.readInt();
        this.message = in.readString();
        this.data = new ArrayList<DataEntity>();
        in.readList(this.data, DataEntity.class.getClassLoader());
    }

    public static final Parcelable.Creator<ResultPost> CREATOR = new Parcelable.Creator<ResultPost>() {
        @Override
        public ResultPost createFromParcel(Parcel source) {
            return new ResultPost(source);
        }

        @Override
        public ResultPost[] newArray(int size) {
            return new ResultPost[size];
        }
    };
}
